package com.guigu.json;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.guigu.array.Student;

public class FastJsonTest2 {

	private int a;
	private BigDecimal b;
	private String c;
	private List<Student> list;

	public String getC() {
		return c;
	}

	public void setC(String c) {
		this.c = c;
	}

	public int getA() {
		return a;
	}

	public void setA(int a) {
		this.a = a;
	}

	public BigDecimal getB() {
		return b;
	}

	public void setB(BigDecimal b) {
		this.b = b;
	}

	public List<Student> getList() {
		return list;
	}

	public void setList(List<Student> list) {
		this.list = list;
	}

	public static void main(String[] args) {
		FastJsonTest2 f = new FastJsonTest2();
		String json1 = JSON.toJSONString(f);
		String json2 = JSON.toJSONString(f, SerializerFeature.WriteMapNullValue, SerializerFeature.WriteNullListAsEmpty,
				SerializerFeature.WriteNullStringAsEmpty, SerializerFeature.WriteNullNumberAsZero);
		System.out.println("json1" + json1);
		System.out.println("json2" + json2);

	}
}